<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/statics/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(function(){
	list();
})
	 function list(){
		 $.ajax({
			"url":"${pageContext.request.contextPath}/petype?opr=findBreed&d="+new Date().getTime(),
			"type":"post",
			"dataType":"json",
			"success":function(data){
					var options = "<option value=\"0\">请选择</option>";
					for(var i=0; i<data.Breed.length;i++){
						options+="<option value=\""+data.Breed[i].vId+"\">"+data.Breed[i].vName+"</option>";
					}
					$(".petBreed").append(options);
				}
		}) 
	}
</script>
</head>
<body>
	<center>
	<h1>宠物的基本信息</h1>
	<form action="${pageContext.request.contextPath}/pet?opr=add" method="post">
		昵称:<input type="text" name="petName" id="petName"/>
		品种:<select id="petBreed" name="petBreed" class="petBreed" >
			
		</select>
		性别: <input type="radio" name="petSex" id="petSex" value="1" checked="checked"/> 雄
			 <input type="radio" name="petSex" id="petSex" value="2"/>雌
		出生日期:<input type="text" name="birthday" id="birthday"/>yyyy-MM-dd
		宠物描述:<textarea name="description" id="description"></textarea>
		<input type="submit" name="sm" value="提交"/>
		<input type="reset" name="rs" value="重置"/>
		</form>
	</center>
</body>
</html>